
package loader.sandbox.net.resource;

import java.io.InputStream;
import java.io.IOException;

import java.net.URL;
import java.net.URLConnection;

/**
 * 
 */
public final class Connection
    extends java.net.URLConnection
{

    private ClassLoader loader;


    public Connection(ClassLoader loader, URL url){
        super(url);
        this.loader = loader;
    }

    public void connect() throws IOException {
    }
    public InputStream getInputStream() throws IOException {

        URL resource = this.loader.getResource(this.url.getPath());

        return resource.openStream();
    }
}
